Fallback to API trade query when HTML query fetch fails#9908
Open
Kanaxai wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9907.
Description of the problem being solved:
When using the "Price Item" feature with a pasted trade URL, PoB attempts to retrieve the saved trade query by downloading and parsing the trade search HTML page.
Recently, this request has started returning HTTP 403 responses for some users, causing the "Price Item" functionality to fail entirely.
This change preserves the existing behavior by first attempting to retrieve the query from the trade search HTML page. If that request fails, PoB now falls back to retrieving the query through the /api/trade/search// endpoint and continues the search normally.
This allows "Price Item" searches initiated from a trade URL to continue functioning even when the trade HTML page cannot be fetched.
Steps taken to verify a working solution:
Verified that "Price Item" succeeds when provided with a valid trade URL that previously returned HTTP 403.
Verified that search results are displayed correctly after the API fallback is used.
Verified that existing behavior remains unchanged when the HTML query fetch succeeds.
Verified that "Find Best" functionality continues to work as expected.
Link to a build that showcases this PR:
N/A
Before screenshot:
After screenshot: